home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 June / CHIP 2006-06.2.iso / program / freeware / Democracy-0.8.2.exe / xulrunner / python / compiled_templates / unittest / hide.py < prev    next >
Encoding:
Python Source  |  2006-04-10  |  3.2 KB  |  58 lines

  1. # This is a generated file. Do not edit.
  2. from template import Handle, fillAttr, quoteAndFillAttr, funcTable
  3. from IOBuffer import IOBuffer
  4. from xhtmltools import urlencode
  5. from templatehelper import quoteattr, escape, evalKey, toUni
  6. def fillTemplate(data, domHandler):
  7.     # Start of handle
  8.     handle = Handle(domHandler)
  9.     # Start of handle
  10.     handle_0 = Handle(domHandler)
  11.     handle.addSubHandle(handle_0)
  12.     # Start of handle
  13.     handle_1 = Handle(domHandler)
  14.     handle.addSubHandle(handle_1)
  15.     # Start of handle
  16.     handle_2 = Handle(domHandler)
  17.     handle.addSubHandle(handle_2)
  18.     # Start of handle
  19.     handle_3 = Handle(domHandler)
  20.     handle.addSubHandle(handle_3)
  21.  
  22.  
  23.     out = IOBuffer()
  24.     out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n")
  25.     out.write(u'<html dtvPlatform="')
  26.     out.write(quoteattr(urlencode(toUni(evalKey(u'dtvPlatform',data)))))
  27.     out.write(u'" eventCookie="')
  28.     out.write(quoteattr(urlencode(toUni(evalKey(u'eventCookie',data)))))
  29.     out.write(u'" xmlns:t=')
  30.     out.write(quoteAndFillAttr(u'http://www.participatorypolitics.org/',data))
  31.     out.write(u' xmlns=')
  32.     out.write(quoteAndFillAttr(u'http://www.w3.org/1999/xhtml',data))
  33.     out.write(u'>\n<head>\n<meta content=')
  34.     out.write(quoteAndFillAttr(u'text/html; charset=utf-8',data))
  35.     out.write(u' http-equiv=')
  36.     out.write(quoteAndFillAttr(u'content-type',data))
  37.     out.write(u'></meta>\n\n</head>\n<body>\n<h1>hide test template</h1>\n')
  38.     if not evalKey(u'bool', data)(evalKey(u'true', data), u'paramtest'):
  39.         for (func, args) in [(0, u'<div>\nhideIfKey:true\n<span>This is an include</span>\n'), (0, u'\n<span>This is a template include</span>\n'), (0, u'\n<span>'), (4, u'replace'), (0, u'</span>\n<span>'), (5, u'replace'), (0, u'</span>\n</div>')]:
  40.             out.write(funcTable[func](data,'',args))
  41.     out.write(u'\n')
  42.     if evalKey(u'bool', data)(evalKey(u'true', data), u'paramtest'):
  43.         for (func, args) in [(0, u'<div>\nhideIfNotKey:true\n<span>This is an include</span>\n'), (0, u'\n<span>This is a template include</span>\n'), (0, u'\n<span>'), (4, u'replace'), (0, u'</span>\n<span>'), (5, u'replace'), (0, u'</span>\n</div>')]:
  44.             out.write(funcTable[func](data,'',args))
  45.     out.write(u'\n')
  46.     if not evalKey(u'bool', data)(evalKey(u'false', data), u'paramtest'):
  47.         for (func, args) in [(0, u'<div>\nhideIfKey:false\n<span>This is an include</span>\n'), (0, u'\n<span>This is a template include</span>\n'), (0, u'\n<span>'), (4, u'replace'), (0, u'</span>\n<span>'), (5, u'replace'), (0, u'</span>\n</div>')]:
  48.             out.write(funcTable[func](data,'',args))
  49.     out.write(u'\n')
  50.     if evalKey(u'bool', data)(evalKey(u'false', data), u'paramtest'):
  51.         for (func, args) in [(0, u'<div>\nhideIfNotKey:flase\n<span>This is an include</span>\n'), (0, u'\n<span>This is a template include</span>\n'), (0, u'\n<span>'), (4, u'replace'), (0, u'</span>\n<span>'), (5, u'replace'), (0, u'</span>\n</div>')]:
  52.             out.write(funcTable[func](data,'',args))
  53.     out.write(u'\n</body>\n</html>')
  54.     out.close()
  55.  
  56.  
  57.     return (out, handle)
  58.